'\" te
.\" Copyright (c) 2007 Sun Microsystems, Inc. - All Rights Reserved.
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LET 1 "Nov 2, 2007"
.SH NAME
let \- shell built-in function to evaluate one or more arithmetic expressions
.SH SYNOPSIS
.SS "ksh"
.LP
.nf
\fBlet\fR \fIarg\fR...
.fi

.SS "ksh93"
.LP
.nf
\fBlet\fR [\fIexpr\fR...]
.fi

.SH DESCRIPTION
.SS "ksh"
.sp
.LP
Each \fIarg\fR is a separate arithmetic expression to be evaluated.
.SS "ksh93"
.sp
.LP
\fBlet\fR evaluates each \fIexpr\fR in the current shell environment as an
arithmetic expression using ANSI C syntax. Variables names are shell variables
and they are recursively evaluated as arithmetic expressions to get numerical
values. \fBlet\fR has been made obsolete by the \fB((...))\fR syntax of
\fBksh93\fR(1) which does not require quoting of the operators to pass them as
command arguments.
.SH EXIT STATUS
.SS "ksh"
.sp
.LP
\fBksh\fR returns the following exit values:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
The value of the last expression is \fBnon-zero\fR.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
The value of the last expression is zero.
.RE

.SS "ksh93"
.sp
.LP
\fBksh93\fR returns the following exit values:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
The last \fIexpr\fR evaluates to a \fBnon-zero\fR value.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
The last \fIexpr\fR evaluates to \fB0\fR or an error occurred.
.RE

.SH SEE ALSO
.sp
.LP
.BR ksh (1),
.BR ksh93 (1),
.BR set (1),
.BR typeset (1),
.BR attributes (7)
